<template>
  <div>
    <CategorySelector :is-disableds="isShowSpuList !== 1" />
    <SpuList
      v-if="isShowSpuList === 1"
      @isShowSpu="isShowSpuList = $event"
      @setSpu="spu = $event"
    />
    <SaveSpu
      v-if="isShowSpuList === 2"
      :current-spu="spu"
      @isShowSpu="isShowSpuList = $event"
    />
    <SaveSku v-if="isShowSpuList === 3" :spu="spu" @isShowSpu="isShowSpuList = $event" />
  </div>
</template>

<script>
import SpuList from './components/SpuList.vue'
import SaveSpu from './components/SaveSpu.vue'
import SaveSku from './components/SaveSku.vue'
export default {
  name: 'Spu',
  components: {
    SpuList,
    SaveSpu,
    SaveSku
  },
  data() {
    return {
      /*
        1 显示 SpuList
        2 显示 SaveSpu
        3 显示 SaveSku
      */
      // isShowSpuList: false,
      isShowSpuList: 1,
      spu: {}
    }
  }
  // methods: {
  //   handelShowSpu(value) {
  //     this.isShowSpuList = value
  //   }
  // }
}
</script>

<style lang="scss" scoped></style>
